package com.koron.css2.clientCenter.Enum;

/**
 * 通知范围类型对应数据库字段枚举类
 * 
 * @author 杨嘉慧
 *
 */
public enum NoticeRangeFieldEnum {

	ALL("1", ""),

	BUSINESS_ABODE("2", "business_abode"),

	BUSINESS_AREA("3", "business_area"),

	BOOK_NO("4", "book_no"),

	USER_NO("5", "user_no");

	private final String rangeType;

	private final String fieldName;

	private NoticeRangeFieldEnum(final String rangeType, final String fieldName) {
		this.rangeType = rangeType;
		this.fieldName = fieldName;
	}

	public static String getFieldName(String rangeType) {
		NoticeRangeFieldEnum[] boticeRangeFieldEnums = values();
		for (NoticeRangeFieldEnum boticeRangeFieldEnum : boticeRangeFieldEnums) {
			if (boticeRangeFieldEnum.rangeType().equals(rangeType)) {
				return boticeRangeFieldEnum.fieldName();
			}
		}
		return null;
	}

	public String rangeType() {
		return this.rangeType;
	}

	public String fieldName() {
		return this.fieldName;
	}
}
